Field of the Invention
The present invention relates to an image processing apparatus, an image processing method, a program, and a storage medium for executing edge enhancement processing.
Description of the Related Art
Conventionally, edge enhancement processing for an image increases the readability of an image of a character and sharpens a photograph, and hence can improve the image quality. The edge enhancement processing generally uses filter-based convolution calculation, and performs conversion such that contrast near edges is enhanced in a resultant image. More specifically, in a position where a bright region and a dark region border each other, a bright portion is converted to have higher brightness and a dark portion is converted to have lower brightness, thus emphasizing the border portion and increasing visual sharpness.
Thus far, many techniques have been disclosed in the field of edge enhancement for a color image.
There is a technique to improve the readability by detecting a black character in an image of a scanned document, applying edge enhancement to a portion including the detected black character, and printing the black character using black ink. For example, color image data is separated into luminance and saturation, a degree of black edges is obtained from an amount of edges and saturation, and enhancement processing is applied to the edges.
Also disclosed is processing for selectively controlling an amount of sharpness enhancement in such a manner that, based on a magnitude relationship with a threshold for lightness of a portion surrounding a target pixel, sharpness of a border of a one-color portion having a clear edge, such as a character and logo, is increased, whereas sharpness of a portion of other designs is suppressed (for example, see Japanese Patent Laid-Open No. H07-274004).
However, if general edge enhancement processing including the above-described techniques is applied, portions near edges may be unnaturally outlined in some cases. For example, an end of an image bordering a white background of a sheet is fundamentally not an image edge that should be enhanced, and if the edge enhancement processing is applied thereto, a portion adjacent to the white background of the sheet is outlined. While this is expected to occur on four sides of a photographic image, edges of other objects, such as a logo and a decorated character, also often border a white background of a sheet. If these edges are excessively outlined as a result of the edge enhancement processing, unnatural outlines become visible in a similar manner. Oftentimes, these image edges fundamentally have sufficient sharpness, and even if an amount of enhancement is suppressed without performing intense edge enhancement processing, they have sufficient image quality in most cases.
On the other hand, if edge enhancement is suppressed so as not to produce harmful effects associated with unnatural outlines, it is often impossible to achieve a sufficient amount of enhancement for an image in which edges should be enhanced.